using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Pay.Data {
    public partial class RegionMap
        : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<Region> {
        public RegionMap() {
            // table
            ToTable("mc_Region", "dbo");

            // keys
            HasKey(t => t.Id);

            // Properties
            Property(t => t.Id)
                .HasColumnName("Id")
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None)
                .IsRequired();
            Property(t => t.Name)
                .HasColumnName("Name")
                .HasMaxLength(50)
                .IsRequired();
            Property(t => t.Sort)
                .HasColumnName("Sort")
                .IsRequired();
            Property(t => t.ParentId)
                .HasColumnName("ParentId")
                .IsRequired();
            Property(t => t.Depth)
                .HasColumnName("Depth")
                .IsRequired();
            Property(t => t.Path)
                .HasColumnName("Path")
                .HasMaxLength(100)
                .IsRequired();
            Property(t => t.FullName)
                .HasColumnName("FullName")
                .HasMaxLength(50)
                .IsRequired();
            Property(t => t.RegionName)
                .HasColumnName("RegionName")
                .HasMaxLength(200)
                .IsRequired();
			Property(t=>t.AreaCode)
				.HasColumnName("AreaCode")
				.IsOptional();

            // Relationships
        }
    }
}
